﻿Imports System.Windows.Media

Public Class CommonMessages
    Public Const MessageTitle As String = "HMS"
    Public Const AddMessage As String = "New Record added sucessfully!"
    Public Const EditMessage As String = "Record Updated sucessfully!"
    Public Const DeleteMessage As String = "Record deleted sucessfully!"

    Public Shared Sub ShowErrorMsg(ByVal err As String)
        Dim ms As New Gat.Controls.MessageBoxView
        Dim vm As Gat.Controls.MessageBoxViewModel
        vm = ms.FindResource("ViewModel")
        vm.Caption = "Error!!!"
        vm.Show(err, Gat.Controls.MessageBoxButton.Ok)
    End Sub

    Public Shared Sub ShowValidationMsg(ByVal Msg As String)
        Dim ms As New Gat.Controls.MessageBoxView
        Dim vm As Gat.Controls.MessageBoxViewModel
        vm = ms.FindResource("ViewModel")
        vm.Caption = "Validation failed"
        vm.Show(Msg, Gat.Controls.MessageBoxButton.Ok)
    End Sub

    Public Shared Sub ShowGeneralMsg(ByVal Msg As String, ByVal caption As String)
        Dim ms As New Gat.Controls.MessageBoxView
        Dim vm As Gat.Controls.MessageBoxViewModel
        vm = ms.FindResource("ViewModel")
        vm.Caption = caption
        vm.Show(Msg, Gat.Controls.MessageBoxButton.Ok)
    End Sub
End Class
